#define _CRT_SECURE_NO_WARNINGS 1
#include <stdio.h>

int main() {
    int n = 0, i = 0, min = 0;
    scanf("%d", &n);
    if (n > 0)
    {
        i = n / 12;
        if (n % 12 == 0)
        {
            min = (i - 1) * 4 + 2;
        }
        else
        {
            min = i * 4 + 2;
        }
    }
    else
    {
        min = 2;
    }
    printf("%d", min);

    return 0;
}